package com.sqlcheck.dto.request;

import com.sqlcheck.common.enums.DatabaseType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

@Data
@Schema(description = "手动SQL分析请求")
public class ManualSqlAnalysisRequest {

    @NotBlank(message = "SQL内容不能为空")
    @Schema(description = "SQL语句内容", example = "SELECT * FROM users WHERE id = 1;\nINSERT INTO logs (user_id, action) VALUES (1, 'login');", required = true)
    private String sqlContent;

    @NotNull(message = "源数据库类型不能为空")
    @Schema(description = "源数据库类型", example = "ORACLE", required = true)
    private DatabaseType sourceDbType;

    @NotNull(message = "目标数据库类型不能为空")
    @Schema(description = "目标数据库类型", example = "GOLDENDB", required = true)
    private DatabaseType targetDbType;

    @Schema(description = "任务名称，可选", example = "用户表查询兼容性分析")
    private String taskName;

    @Schema(description = "是否保存分析结果", example = "false")
    private Boolean saveResult = false;

    @Schema(description = "分析引擎类型", example = "RULE_BASED", allowableValues = {"RULE_BASED", "LLM_BASED", "HYBRID"})
    private String analysisEngine = "RULE_BASED";

    @Schema(description = "是否启用LLM分析", example = "false")
    private Boolean enableLLMAnalysis = false;

    @Schema(description = "是否启用规则优化", example = "true")
    private Boolean enableRuleOptimization = true;
}